#include "EnemyFightInfo.h"
#include "Character\NonPlayerCharacter.h"
#include "qpainter.h"

EnemyFightInfo::EnemyFightInfo(NonPlayerCharacter &iCharacter) : mEnemy(iCharacter)
{
	setFixedWidth(300);
}

void EnemyFightInfo::paintEvent(QPaintEvent *event)
{
	QPainter qpainter(this);
	QFont header = this->font();
	header.setPointSize(10);
	int x = 10;
	int y = 20;
	int sp = 20;
	int fh = header.pointSize() * 2;

	// Player area
	qpainter.setFont(header);
	qpainter.drawText(x,y,mEnemy.getName().c_str());
	y += header.pointSize() + sp;
	qpainter.drawImage(x, y, *(mEnemy.getPicture()));

	x += mEnemy.getPicture()->width() + sp;
	
	qpainter.drawText(x, y, "Characteristics: ");
	y += fh * 2;
	qpainter.drawText(x, y, QString("Strength value: ").append(QString::number(mEnemy.getStrengthValue())));
	y += fh * 3;
	qpainter.drawText(x, y, QString("------------------------"));
	y += fh;
	qpainter.drawText(x, y, QString("Total strength: ").append( QString::number(mEnemy.getStrengthValue())));
}